using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rotempco.Core.Logging.Objects;
using Rotempco.Core.ORM.ADAL;
using Rotempco.Core.ORM.Objects;
using Rotempco.Core.ORM.Logic;
using Rotempco.Core.Logging.EntityObjects.Objects;

namespace Rotempco.Core.Logging.DAL
{
    internal class LogStackData : ADAL<LogStack,long>
    {
        #region [ ADATA Implementation ]

        protected internal override string GetTableName()
        {
            return "LogStack";
        }

        protected internal override Pair<string, string> GetIdentity()
        {
            return new Pair<string, string>("LogStackId", SymbolExtensions.GetPropertyName((LogStack d) => d.LogStackId));
        }

        protected internal override List<ORMParameter> GetORMMapping()
        {
            List<ORMParameter> mapping = new List<ORMParameter>();

            mapping.Add(new ORMParameter("Message", SymbolExtensions.GetPropertyPair((LogStack d) => d.Message)));
            mapping.Add(new ORMParameter("Exception", SymbolExtensions.GetPropertyPair((LogStack d) => d.Exception)));
            mapping.Add(new ORMParameter("Method", SymbolExtensions.GetPropertyPair((LogStack d) => d.Method)));
            mapping.Add(new ORMParameter("ClassName", SymbolExtensions.GetPropertyPair((LogStack d) => d.ClassName)));
            mapping.Add(new ORMParameter("TimeStamp", SymbolExtensions.GetPropertyPair((LogStack d) => d.TimeStamp)));

            return mapping;
        }

        #endregion
    }
}
